Događaj
Power BI DataViz Svetsko prvenstvo
14. feb 16 - 31. mar 16
Sa 4 šanse za ulazak, možete osvojiti konferencijski paket i stići do LIVE Grand Finale u Las Vegasu
Saznajte višeOvaj pregledač više nije podržan.
Nadogradite na Microsoft Edge biste iskoristili najnovije funkcije, bezbednosne ispravke i tehničku podršku.
This document lists known breaking changes in Razor after .NET 8 general release (.NET SDK version 8.0.100) through .NET 9 general release (.NET SDK version 9.0.100).
Introduced in VS 17.10 and .NET 8.0.300
In https://github.com/dotnet/razor/pull/10232, we adjusted the behavior of how an identifier is parsed following an @
to be more consistent across Razor.
This resulted in a few scenarios that have different behavior, listed below.
Strings of the form @$"ticket-{i}.png"
are no longer recognized. This will be fixed in a later release by changing to a new lexer; until then, use $@
to work around the issue.
@{
#region R
<h3>@ViewData["Title"]</h3>
#endregion
}
switch
statements:@{
switch (true)
{
#region R
case true:
<div>@(1 + 1)</div>
break;
}
}
Previously, C# preprocessor directives followed by HTML would sometimes be parsed correctly if the HTML had an @
transition in it. It is now consistently parsed
incorrectly. This will be resolved in a later release by changing to a new lexer. Until then, there are available workarounds to get this to compile.
The HTML can be surrounded with braces.
@{
#if DEBUG
{
<h3>@ViewData["Title"]</h3>
}
#endif
}
Directives such as #region
and #endregion
allow putting a semicolon after the directive. This will effectively work around the issue.
@{
#region R ;
<h3>@ViewData["Title"]</h3>
#endregion
}
Directives such as #if
and #endif
do not allow semicolons after the directive condition, but one can be placed on the next line to make an empty statement.
@{
#if DEBUG
;
<h3>@ViewData["Title"]</h3>
#endif
}
Povratne informacije za ASP.NET Core
ASP.NET Core je projekat otvorenog koda. Izaberite vezu da biste pružili povratne informacije:
Događaj
Power BI DataViz Svetsko prvenstvo
14. feb 16 - 31. mar 16
Sa 4 šanse za ulazak, možete osvojiti konferencijski paket i stići do LIVE Grand Finale u Las Vegasu
Saznajte višeObuka
Modul
Build rich interactive components with Blazor web apps - Training
Learn how to interoperate Blazor apps with JavaScript code, use templated components, and handle component lifecycle events.
Dokumentacija
Razor compiler breaking changes since .NET 9
Learn about any breaking changes since the initial release of .NET 9.
Reusable Razor UI in class libraries with ASP.NET Core
Explains how to create reusable Razor UI using partial views in a class library in ASP.NET Core.
Learn how Razor Pages in ASP.NET Core makes coding page-focused scenarios easier and more productive than using MVC.